﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Unity;
using ZFSDomain.Interface.Serivce;

namespace ZFSDomain.Service
{
    /// <summary>
    /// Unity实例
    /// </summary>
    class UnityServiceLocator:IUnityLocator
    {
        private UnityContainer container;

        public UnityServiceLocator()
        {
            container = new UnityContainer();
        }

        void IUnityLocator.Register<TInterface, Template>()
        {
            container.RegisterType<TInterface, Template>();
        }

        TInterface IUnityLocator.Get<TInterface>()
        {
            return container.Resolve<TInterface>();
        }
    }
}
